import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/RoutesPath.dart';
import 'package:flutter_app/screen_page.dart';

class AttentionPage extends StatefulWidget {
  @override
  _AttentionPageState createState() => _AttentionPageState();
}

class _AttentionPageState extends State<AttentionPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: double.infinity,
      child: ListView.builder(
          itemCount: 10,
          itemBuilder: (context, index) {
            return _dynamicItem(index);
          }),
    );
  }

  Widget _dynamicItem(int index) {
    return Container(
        padding: EdgeInsets.all(height(12)),
        margin:
            EdgeInsets.only(top: width(12), left: width(12), right: width(12)),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(height(6)),
            color: Colors.white),
        child: InkWell(
          onTap: () {
            if (index == 0) {
              Navigator.pushNamed(context, RoutesPath.topicDetail,
                  arguments: 92);
            } else if (index == 1) {
              Navigator.pushNamed(context, RoutesPath.myPage);
            } else {
              Navigator.pushNamed(context, RoutesPath.bigCircle);
            }
          },
          child: Column(
            children: <Widget>[
              Row(
                children: <Widget>[
                  Container(
                    height: height(34),
                    width: height(34),
                    child: ClipOval(
                      child: Image.network(
                          "https://image.xiajiucai.com/billionbottle/avatar/99aeb510fe7091a3068c9cc556e73595_0_428x429.png"),
                    ),
                  ),
                  Expanded(
                      flex: 1,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          Text("软糖轰炸机软糖轰炸机软糖轰炸机软糖轰炸机软糖轰炸机软糖轰炸机",
                              style: TextStyle(
                                fontSize: sp(14),
                                color: Colors.black,
                                fontWeight: FontWeight.bold,
                              ),
                              overflow: TextOverflow.ellipsis,
                              maxLines: 1),
                          Text("2小时前 发布了动态",
                              style: TextStyle(
                                fontSize: sp(12),
                                color: Colors.black12,
                                fontWeight: FontWeight.bold,
                              ),
                              overflow: TextOverflow.ellipsis,
                              maxLines: 1),
                        ],
                      ))
                ],
              ),
              SizedBox(
                height: height(10),
              ),
              Text(
                  "但我们需要进一步的学习，"
                  "了解下红酒的产地品种，"
                  "生长环境，酿造工艺等..."
                  "会让你加深对这款红酒的印象，"
                  "也会提高品酒的水平，最好的…",
                  style: TextStyle(
                    fontSize: sp(14),
                  ),
                  maxLines: 3,
                  overflow: TextOverflow.ellipsis),
              Wrap(
                children: <Widget>[],
              )
            ],
          ),
        ));
  }
}
